package com.atguigu.day13.work;

public class Even extends Thread{
    private int num =2;

    @Override
    public void run() {
        while (true){
            synchronized (Thread.class){
                for (int i=1;i<=5;i++){
                    num+=2;
                    System.out.println("偶数线程，第" + i + "个：" + num);
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }
}
